'''
Created on Jul 14, 2009

@author: mkiyer
'''

from optparse import OptionParser
from veggie.sample.sampledb import SampleDB

if __name__ == '__main__':
    optionparser = OptionParser("usage: %prog [options]")
    optionparser.add_option("--fc", "--flowcell", dest="flowcell",
                            help="flowcell id")
    optionparser.add_option("--lane", dest="lane", type="int",
                            help="lane id")
    optionparser.add_option("--fmt", "--format", dest="format", 
                            default="export",
                            help="file format: export, sorted, eland_query, "
                                 "eland_multi, or eland_extended "
                                 "[default: %default]")
    optionparser.add_option("-p", "--pair", dest="pair", type="int",
                            default=None,
                            help="paired-end file: None, 1, or 2 "
                                 "[default: %default]") 

    (options, args) = optionparser.parse_args()
    if not args:
        pass
    if not options.flowcell:
        optionparser.error('no flowcell specified')

    db = SampleDB()
    filenames = db.get_sample_data_files(options.flowcell, options.lane,
                                         options.format, options.pair) 
    print filenames
